package com.t2t.top.thread.jdk_future;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

/**
 * Created by yangpengfei on 2016/12/2.
 */
public class FeaureMain {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //构造FutureTask
        FutureTask<String> futrue = new FutureTask(new RealData("a"));
        ExecutorService exector = Executors.newFixedThreadPool(1);
        exector.submit(futrue);
        System.out.println("请求完毕");
        System.out.println("结果:" + futrue.get());
    }

}
